package com.jueban.controller;

import com.jueban.Vo.UploadFileVo;
import com.jueban.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/api")
@RestController
public class FileController {

    final private FileService fileService;


    @Autowired
    public FileController(FileService fileService) {
        this.fileService = fileService;
    }

    @RequestMapping(value = "",method = RequestMethod.POST)
    public UploadFileVo uploadFile(@RequestParam("file")MultipartFile file){
        return fileService.uploadFile(file);
    }


}

